﻿Imports DTO
Imports DAO

Public Class SachBUS
    Public Sub Them(ByRef sDTO As SachDTO)
        Dim sDAO As New SachDAO
        sDAO.Them(sDTO)
    End Sub

    Public Function LayBang() As IQueryable(Of Object)
        Dim sDAO As New SachDAO
        Dim dt As IQueryable(Of Object)
        dt = sDAO.LayBang()
        Return dt
    End Function

    Public Function TimKiem(ByVal sDTO As SachDTO) As IQueryable(Of Sach)
        Dim sDAO As New SachDAO
        Dim saches As IQueryable(Of Sach)
        saches = sDAO.TimKiem(sDTO)
        Return saches
    End Function

    Public Function TimKiemTheoTenSach(ByVal tenSach As String) As IQueryable(Of Object)
        Dim sDAO As New SachDAO
        Dim saches As IQueryable(Of Object)
        saches = sDAO.TimKiemTheoTenSach(tenSach)
        Return saches
    End Function

    Public Function TimKiemTheoTenTG(ByVal tenTG As String) As IQueryable(Of Object)
       Dim sDAO As New SachDAO
        Dim saches As IQueryable(Of Object)
        saches = sDAO.TimKiemTheoTenTG(tenTG)
        Return saches
    End Function

    Public Function TimKiemTheoTheLoai(ByVal maTheLoai As Integer) As IQueryable(Of Object)
        Dim sDAO As New SachDAO
        Dim saches As IQueryable(Of Object)
        saches = sDAO.TimKiemTheoTheLoai(maTheLoai)
        Return saches
    End Function

    Public Function TimKiem_GiamSoLuong(ByVal sDTO As SachDTO) As Sach
        Dim sDAO As New SachDAO
        Return sDAO.TimKiem_GiamSoLuong(sDTO)
    End Function

    Public Sub CapNhat(ByVal sDTO As SachDTO)
        Dim sDAO As New SachDAO
        sDAO.CapNhat(sDTO)
    End Sub

    Public Function SoLuongTon(ByVal sDTO As SachDTO) As Integer
        Dim sDAO As New SachDAO
        Return sDAO.SoLuongTon(sDTO)
    End Function
End Class
